<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/template-web.js"></script>
</head>

<body>
    <ul></ul>

    <script type='text/html' id='qq'>
        {{each aa.arr1 item}}
            <li>11111======={{item.name}}</li>
        {{/each}}

        *******
        {{ddd}}
        {{fff}}

        &&&&&&&
        {{$imports.yyy()}}
    </script>

    

    <script>
        template.defaults.imports.yyy=function(msg){
            var  time=new  Date()
            var  y=time.getFullYear()
            var  m=time.getMonth()+1
            var  d=time.getDate()

            var  hh=time.getHours()
            var  mm=time.getMinutes()
            var  ss=time.getSeconds()
            return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
        }

        var  aaa=[
            {id:1,name:'jack'},
            {id:2,name:'rose'}
        ]
        var  html=template('qq',{
                aa:{arr1:aaa },
                ddd:666666,
                fff:123
            }
        )

        var uls = document.querySelector('ul')
        uls.innerHTML = html
    </script>
</body>

</html>